<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo1"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<body>

<div class="layui-card">

    <div class="layui-card-line"></div>

    <div class="layui-card-body">

        <div class="layui-card-table layui-tab">
            <div class="layui-tab-content">
                <form th:replace="/pcs/porter_credentials/index_search">

                </form>
                <table id="PorterCredentialsTable" th:attr="data-url=${'/pcs/porter/credentials/index?porterId='+porterId}" data-target-search="form.form-search"></table>
                <script type="text/javascript" th:inline="none">
                    $(function () {
                        $('#PorterCredentialsTable').layTable({
                            even: true,
                            cols: [[
                                {title: '序号', type: 'numbers', width: 80},
                                {field: 'title', title: '证书名称', minWidth: 180, align: 'center'},
                                {field: 'expireDate', title: '证书到期时间', align: 'center'},
                                {field: 'img', title: '证书图片', align: 'center', minWidth: 110, templet: function (d) {
                                        if (!d.img) return '-';
                                        return layui.laytpl('<div class="headimg  shadow-inset margin-0" style="width: 150px;height: 50px;border-radius: 0" data-tips-image data-tips-hover data-lazy-src="{{d.img}}"></div>').render(d);
                                }},
                                {toolbar: '#toolbar1', title: '操作', align: 'center', minWidth: 200, fixed: 'right'}
                            ]]
                        });
                    });



                </script>


                <script type="text/html" id="toolbar1">
                    <a class="layui-btn layui-btn-sm" data-event-dbclick data-title="编辑证书" shiro:hasPermission="pcs:porterCredentials:add" data-height="300px"  data-modal='/pcs/porter/credentials/form?id={{d.id}}&porterId={{d.porterId}}'>编 辑</a>
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-event-dbclick  shiro:hasPermission="pcs:porterCredentials:state" data-action='/pcs/porter/credentials/state?id={{d.id}}&status=3'>删除</a>
                </script>

            </div>
        </div>
    </div>

</div>
</body>
</html>